#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <ncurses.h>
#include "../Model/Model.h"
#include "../Model/Library.h"
#include "../IO/AudioModule.h"
#include "LibraryView.h"
#include "AMView.h"


class View {

private: //Константы
	static int const V_SWITCH_KEY = 119; // key w
	static int const V_EXIT_KEY = 113; // key q
	static int const V_END_KEY = 101; // key e
	static int const V_SWITCH_MENU_KEY= 115; // key s
	static int const V_COL_CORRECT = 30; // хмм
	static int const V_PM_START = 112; // key p
	//static int const L_OK_KEY = 10; // key Enter
	//static int const PM_STOP = 119; // w
	//static int const PM_PLAY = 115; //s 
	//static int const PM_CLOSE = 113; // q
	//static int const PM_FORWARD = 114;// r
	//static int const PM_ADJUST = 'a';

	AMView amv;
	LibraryView lv;
	

private:
	bool exit;
	size_t first_line_shown;
	int row;
	int col;
	int oldCol;
	size_t carry;	
	Model model;

	WINDOW * createWindow(int h, int w, int x, int y);
	void destroyWindow(WINDOW * win);

public:
	//View(Model & m);
	View(Library & l);
	void init();
	void show(int isUp);
	void showByStrings();
	void showLibrary();
	void doMainCycle();
	void showSwitchMenu();
	~View();
};
